package com.ymy.thinking.in.spring.bean.instance;

import com.ymy.thinking.in.spring.bean.entity.Person;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author Ringo
 * @date 2021/8/27 20:39
 */
public class PersonFactoryInstanceDemo {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        applicationContext.scan("com.ymy.thinking.in.spring.bean.instance.**");
        applicationContext.refresh();

        Person person = applicationContext.getBean(Person.class);
        System.out.println(person);

        applicationContext.close();

    }

}
